package od.igor.petrov.servlet;

/* ========================================== *
 * SERVLET THAT POPULATES DB WITH SAMPLE DATA
 * ========================================== */

import java.io.IOException;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import od.igor.petrov.bcontrol.DataPreparation;

public class PopulateDB extends HttpServlet{

	private static final long serialVersionUID = 1170254488707502448L;

	public void doGet(HttpServletRequest request, HttpServletResponse response){
		DataPreparation prep = new DataPreparation();
		prep.populateDB();
		try {
			response.sendRedirect(REDIRECT_TO);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	private static final String REDIRECT_TO = "../Index.jsp";
}
